var footerD={
	init:function(){
		var html="<footer class='bGWhite' style='border:none;'><ul><li class='tC index-cart' style='border-top:2px solid #d9d9d9'>"
				+"<div class='tC pSR dIB'><img src='../img/icon/cart1.png' width='25px' height='25px' class='mB15'/>"
				+"<i class='dtl-inum cWhite' style='font-size:12px;line-height:17px'>0</i></div></li><li class='addCart'><button class='w btn btn-black fS15'>加入购物车</button>"
				+"</li><li class='toBuy'><button class='w  btn btn-black fS15'>立即购买</button></li></ul></footer>";
		$('body').append(html);
		$('body').on('click','footer .index-cart',function(){
    		app.open('cart.html',{},window.location.href,document.body.scrollTop)
    	});
    	
    	
    	app.ajax(
    		'/Goods/Cart/count_cart',
    		null,
    		function(res){
    			if(res.code ==200){
    				if(res.count){
    					$('footer .index-cart i').text(res.count);
    				}else{
    					$('footer .index-cart i').text(0);
    				}
    			}
    		}
    	);
    	
	},
	buy:function(data){
		app.ajax(
			'/Goods/Cart/upgradehongren',
			data,function(res){
				if(res.code == 200){
					app.open('accout.html','accoutD',{skuid : data.skuid,data1:data},window.location.href,document.body.scrollTop);
				}else{
					layer.msg(res.msg);
				}
		});
	}
}
